/*-------------------------------------------------------------------------
 * CLR版本:     4.0.30319.42000
 * 创建人:      song
 * 创建时间：   2024/4/9 17:56:20
 * 功 能：      自发光模块
 *-------------------------------------------------------------------------*/

#if UNITY_EDITOR
namespace SCore.Editor.SShaderDraw
{
    using System.Collections.Generic;
    using UnityEditor;
    using UnityEngine;

    public class SRimProGUI : SComponentGUIBase
    {
        private SToggleProp _RimLight;
        private SRangeProp _RimPower;
        private SColorProp _RimColor;


        public override void RefreshProperties()
        {
            this.lProps.Clear();
            this.lProps.Add(_RimPower);
            this.lProps.Add(_RimColor);
        }

        public override void Changed()
        {
        }

        public override void DrawProperties()
        {
            if (_RimLight.Exist)
            {
                GUILayout.BeginVertical("box");
                base.DrawPartTitle(_RimLight, Styles.RimLight, 15f, new SPropBase[] { _RimPower, _RimColor });
                GUILayout.EndVertical();
            }
        }

        public SRimProGUI(MaterialEditor materialEditor, Dictionary<string, MaterialProperty> dics) : base(
            materialEditor, dics)
        {
            this._RimLight = new SToggleProp("_RimLight", Styles.RimLight, materialEditor, dics, 1f,
                SShaderEditorHelpr.GetInternelStyle("BoldTextField"));
            this._RimPower = new SRangeProp("_RimPower", Styles.RimPower, materialEditor, dics, 0.001f, 5f);
            this._RimColor = new SColorProp("_RimColor", Styles.RimlColor, materialEditor, dics, Color.white);
        }


        private class Styles
        {
            public static GUIContent RimlColor = new GUIContent("颜色", "颜色");
            public static GUIContent RimPower = new GUIContent("强度", "强度");
            public static GUIContent RimLight = new GUIContent("边缘光", "边缘光");
        }
    }
}
#endif